package 多线程.Thread类分析;

public class Test {
    public static void main(String[] args) throws InterruptedException {
        Thread thread1 = new Thread(new Task());
        Thread thread2 = new Thread(new Task());
        Thread thread3 = new Thread(new Task());
        thread3.setDaemon(true);
        thread1.setPriority(1);
        thread2.setPriority(7);
        thread1.join();
        Thread.interrupted();
        thread1.isInterrupted();
        thread1.start();
        thread2.start();
        thread3.start();
        System.out.println(Thread.currentThread().getName());
    }

    static class Task implements Runnable {
        @Override
        public void run() {
            System.out.println(Thread.currentThread().getName());
        }
    }
}
